--[[
* 免疫伤害
*]]
---@class BuffEffect78 : BaseBuffEffect
BuffEffect78 = ClientFight.CreateClass("BuffEffect78", ClientFight.BaseBuffEffect)
local t = BuffEffect78
---@param fight Fight
---@param buff FighterBuff

function t:action(fight, buff, ...)
    local parameters = {...};
    if (parameters[3].__cname == "FightResult") then
        local result = parameters[3];
        if (not AttackUtils.isDamage(result.state)) then
            return IBuffEffect.FAIL;
        end
        if (not result:isDamage()) then
            return IBuffEffect.FAIL;
        end
        result.damage = 0;
        result.state = DamageResultTypeEnum.IMMUNITY;
        return ClientFight.BaseBuffEffect.action(self, fight, buff, parameters);
    end
    return IBuffEffect.FAIL;
end

t.New()